package com.yunfei.yunmusic.web.control;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;

@Controller
public class MusicControl {
   private static final  Map<String,String> musics=new HashMap<>();
    @ResponseBody
    @RequestMapping(value ="/song/music")
    public String getMusic(String songId){
        return musics.get(songId);
    }
    @PostConstruct
    public void init(){
        musics.put("1346104327",
                "http://music.163.com/song/media/outer/url?id=1346104327.mp3");
        musics.put("329925","http://music.163.com/song/media/outer/url?id=329925.mp3");
    }


}
